import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class BookAddedSessionListener implements HttpSessionListener {
    static private int activeSessions;
    public static int getActiveSessions() {
        return activeSessions;
    }

    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        activeSessions++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        activeSessions--;
    }
}
